package utility

import (
	"fmt"
	"go.mongodb.org/mongo-driver/bson"
)

type JsonResult struct {
	Err int `json:"err"`
	Msg string `json:"msg"`
	Data interface{} `json:"data"`
}



func GetShowPhoto (chatState bson.M, sex int, userId int, size int) string {

	var photoPath string

	if len(chatState) != 0 && chatState["photo"] != "" {
		photoPath = fmt.Sprintf("user/%d/%d.jpg", userId, size)
	} else {
		if sex != 0 {
			photoPath = fmt.Sprintf("default_woman/%d.jpg", size)
		} else {
			photoPath = fmt.Sprintf("default_man/%d.jpg", size)
		}
	}

	return photoPath

}